package com.io;

import java.io.*;

/**
 * @author weijingchen
 * @DateTime 2025-06-17
 */
public class BufferedStreamTest02 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("src/main/resources/a.txt"));
        BufferedWriter bw = new BufferedWriter(new FileWriter("src/main/resources/b.txt"));
        try (br; bw){
            String line;
            while ((line = br.readLine()) != null) {
                bw.write(line);
                bw.newLine();
            }

        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
